package _struct

import "fmt"

type Animal struct {
	Name   string
	Age    int
	Weight int
	Height int
}

func NewAnimal(name string, age int, weight int, height int) *Animal {
	return &Animal{Name: name, Age: age, Weight: weight, Height: height}
}

/**
 * get set方法
 */
func (a *Animal) SetName(name string) {
	a.Name = name
}

func (a *Animal) SetAge(age int) {
	a.Age = age
}

/**
 * 动物吃东西
 */
func (a Animal) Eat(food string) {
	fmt.Printf("Animal %s is eating %s \n", a.Name, food)
}
